/**
 * 
 */

//function test(){
//	this.a = 30;
//}
//
////var a = new test();
////alert(a.a);
//
//(function(){
//	alert("Selbstzünder");
//})();
//
//funk = function(){
//	alert("Test funktion");
//};
//
//
//var literal = {
//	eigenschaft : "literal",
//	methode : function(){
//		alert(this.eigenschaft);
//	}
//};

function test(){
	var varPrivate = "private";
	this.varPublic = "public";
	varGlobal = "global";
	
	var methodePrivate = function(){
		console.log("methodePrivate");
	};
	
	this.methodePublic = function(){
		console.log("methodePublic");
	};
	
	methodeGlobal = function(){
		console.log("methodeGlobal");
	};
	
	function methodePrivat2(){
		console.log("methodePrivat2");
	};
}
test2 = function(){
	this.methode = function(){
		console.log("methode");
	};
};



var obj = new test();

obj.neuEigenschaft = "neue Eigenschaft";

console.log(obj.neuEigenschaft);

var obj1 = new test();

console.log(obj1.neuEigenschaft);

obj.newVar = "newVar";

console.log(obj.newVar);

var obj1 = new test();

//console.log(obj2.newVar);

console.log(obj.varPrivate); //undefined 

console.log(obj.varPublic); //varPublic

console.log(obj.varGlobal); //undefined 

console.log(varGlobal); //varGlobal

console.log(window.varGlobal); //varGlobal

console.log(obj.varGlobal); //undefined

console.log(Object.varGlobal); //undefined 

console.log(document.varGlobal); //undefined

//obj.methodePrivate(); //Uncaught TypeError: Object #<test> has no method 'methodePrivate' 

//obj.methodePrivate2(); //Uncaught TypeError: Object #<test> has no method 'methodePrivate2' 

obj.methodePublic();

//obj.methodeGlobal(); //Uncaught TypeError: Object #<test> has no method 'methodeGlobal'

methodeGlobal();

window.methodeGlobal();
